<?php 
define('IN_QY',true);
session_start();
require("include/common.inc.php");
?>
<!doctype html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0" />
    <meta name="format-detection" content="telephone=no,email=no,date=no,address=no">
    <title>母婴分类</title>
    <link href="/ui/css/Hui.css" rel="stylesheet" type="text/css" />
    <style type="text/css">
		.H-tabs-active:after { border-right: 2px solid #fff; z-index: 100; }
	    #header{width:100%; position:absolute; top:0;}	
     #main{width:100%; overflow: auto; position:absolute; top:45px;bottom:0px;}		
    </style>
</head>
<body>
    <header class="H-header H-theme-background-color-white" id="header" >
        <span tapmode="" onclick="H.openWin('index','index.php')" class="H-icon H-position-relative H-display-inline-block H-float-left H-vertical-middle H-theme-font-color-black H-padding-horizontal-left-5 H-z-index-100"><i class="H-iconfont H-icon-arrow-left H-font-size-18 H-vertical-middle"></i></span>
        <div class="H-header-title H-center-all H-font-size-18 H-text-show-row-1 H-theme-font-color-black H-position-absolute H-width-100-percent">母婴分类</div>
    </header>
<div id="main">
   <div class="H-flexbox-horizontal H-width-100-percent H-height-100-percent H-overflow-hidden">
    <div class="H-tabs-channel H-width-100  H-height-150-percent H-overflow-scrolling H-border-horizontal-right-after H-theme-background-color-f4f4f4">
        
        <ul class="H-width-100-percent H-auto-height">
            

        <?php 
                    $sql_cat = "select * from tbl_specifa where type=2 and pid=0 and status=0 order by id asc";
                    $query_cat = mysql_query($sql_cat);
                    while ($row_cat=mysql_fetch_array($query_cat)) { 
        ?> 

            <li tapmode=""  value="<?php echo $row_cat['id'] ?>" style="height: 50px"  class="H-channel-item H-font-size-12 H-padding-10 H-text-show-row-1 H-font-weight-500 H-border-vertical-bottom-after H-width-100-percent H-box-sizing-border-box"><?php echo $row_cat['spe_val'] ?></li>

        <?php } ?>    
            
        </ul>

    </div>
    <div class="H-tabs-items H-theme-background-color-white H-flex-item H-height-100-percent H-overflow-scrolling">
           <div class="H-tabs-item H-padding-vertical-both-10 H-padding-horizontal-left-10">
           
 


        <div class="H-clear-both H-width-100-percent H-display-table H-box-sizing-border-box">
            <div class="H-tabs-item H-padding-vertical-both-10 H-padding-horizontal-left-10">
                <div id="fenlei" class="H-clear-both H-width-100-percent H-display-table H-box-sizing-border-box">
                    <ul class="H-width-100-percent H-auto-height">
                        

                    <?php 
                                $sql_cat = "select * from tbl_specifa where pid=48 order by id desc";
                                $query_cat = mysql_query($sql_cat);
                                while ($row_cat=mysql_fetch_array($query_cat)) { 
                    ?> 

                        <a href="mysearch.php?s=<?=$row_cat['spe_val']?>" id="fenlie"><div class="H-display-table-cell H-float-left  H-box-sizing-border-box H-width-avg-3 H-padding-horizontal-right-10 H-margin-vertical-bottom-20">
						<!---------------------
						<img src="<?php echo $row_cat['img'] ?>" class="H-width-100-percent H-display-block" alt="" title="" style="width:75px;height:75px" />
						----------------->
						<div class="H-text-align-center H-font-size-14" style="border: 1px solid #c3b6b6;border-radius: 13px;color: #42424c;"><?php echo $row_cat['spe_val'] ?></div></div></a>

                    <?php } ?>    
                        
                    </ul>                    
                     
                   
                </div>
            </div>
        </div>
        
     </div>
    </div>
    </div>
    <script src="/ui/script/H.js" type="text/javascript"></script>

<script src="/ui/js/jquery.min.js"></script>      
        
  <script>
          $('li').click(function(){
            var pcode=$(this).val();
            $.ajax({
                //取消异步，也就是必须完成上面才能走下 
                async:false,           
                url:'myfenleiapi.php',
                data:{pcode:pcode},
                type:'POST',
                dataType:'text',
                success: function(res){
                    console.log(res);
                  var str="";
                  console.log(str);
                  //遍历数组，把它放入sj                 
                  var data=eval(res);
                  for(var k in data){
                    console.log(data[k][0]);
                   str += '<a href="mysearch.php?s='+data[k][1]+'" id="fenlie"><div class="H-display-table-cell H-float-left  H-box-sizing-border-box H-width-avg-3 H-padding-horizontal-right-10 H-margin-vertical-bottom-20"><div class="H-text-align-center H-font-size-14 " style="border: 1px solid #c3b6b6;border-radius: 13px;color: #42424c;">'+data[k][1]+'</div></div></a>';
                  }
                   $('#fenlei').empty();
                  $('#fenlei').append(str);
                },
                error:function(res){
                    console.log("你出错了第一个、。");
                }       
              });
        });
             
   
</script>   


    <script type="text/javascript">
        H.on(H.Ds(".H-tabs-channel ul li"), "touchend", function (event) {
            var channel_item = H.getParents(event.target, "H-channel-item");
            var index = H.getIndex(channel_item);
            H.addClass(channel_item, "H-tabs-active H-theme-font-color4 H-theme-background-color-white");
            H.removeClass(H.siblings(channel_item), "H-tabs-active H-theme-font-color4 H-theme-background-color-white");

            var tab_item = H.D(".H-tabs-items .H-tabs-item:nth-child(" + (index + 1) + ")")
            H.removeClass(tab_item, "H-display-none-important");
            H.addClass(H.siblings(tab_item), "H-display-none-important");
        });
    </script>



</body>
</html>